﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MyCompanyName.AbpZeroTemplate.Daybooks.Dto
{
    [Abp.AutoMapper.AutoMap(typeof(DaybookItem))]
    public class DaybookItemEditDto
    {
        public int? Id { get; set; }

        #region 冗余 主表的 信息

        [System.ComponentModel.DataAnnotations.Required]
        public long AccountId { get; set; }
        public string AccountName { get; set; }
        public DateTime BookDay { get; set; }

        #endregion



        [System.ComponentModel.DataAnnotations.Required]
        public int Index { get; set; }
        [System.ComponentModel.DataAnnotations.Required]
        public string Work { get; set; }
        [System.ComponentModel.DataAnnotations.Required]
        public WorkStatus State { get; set; }
        [System.ComponentModel.DataAnnotations.Required]
        public string Customer { get; set; }
        [System.ComponentModel.DataAnnotations.Required]
        public string Product { get; set; }

        [System.ComponentModel.DataAnnotations.Required]
        public Single ManHour { get; set; }

        public string Remark { get; set; }

        public string ManHourDisplay
        {
            get
            {
                if (ManHour > 0)
                {
                    return ManHour.ToString();
                }
                return string.Empty;
            }
        }


        public bool IsEditMode
        {
            get
            {
                return Id.HasValue;
            }
        }
    }
}
